<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body ng-app="app">
		<div ng-controller="myController">
<div share-directive=""></div>
</div>
<script type="text/javascript" src="../js/angular.js" ></script>
<script>
	/*共享*/
	var  app=angular.module("app",[]);
	app.controller("myController",
function($scope) {
	$scope.name ="hello world";
    }).directive("shareDirective", function () {
    return {
            template: 'Say:{{name}}'
    }
});
/*隔离*/
app.controller("myController", function ($scope) {
    $scope.name = "hello world";
}).directive("isolatedDirective", function () {
        return {
            scope: {},
            template: 'Say:{{name}}'
        }
});
</script>
	</body>
</html>
